from kaikela import InterfaceList

# 更新接口
def updateInterface():
    interfaceList = InterfaceList.showList()  # kkl_kapi中的所有接口
    newList = InterfaceList.showNewList(interfaceList)  # 未包含在kkl_zhiliang中的接口
    InterfaceList.insertNewList(newList)  # 更新kkl_zhiliang的库

# 筛选出所有已完成的数据
def updateCompeletedInterface():
    compeleteInterfaceList = []
    interfaceList = InterfaceList.showList()
    foread = open("C:\\Users\\tangchenqian\\workspace\\InterFaceATest\\src\\testng.xml", encoding='utf8').read()
    for datalist in interfaceList:
        interfaceUrl = datalist[1]
        facade_method = str(interfaceUrl).split(".")[-2] + "." + str(interfaceUrl).split(".")[-1]
        if foread.count(facade_method) > 0:
            compeleteInterfaceList.append(facade_method)
    return compeleteInterfaceList


# updateInterface()
compeleteInterfaceList = updateCompeletedInterface()
InterfaceList.compeleteTask(compeleteInterfaceList)

